package com.jeesite.modules.recovery.entity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @描述: 操作员类型 . <br/>
 * 适用于表：
 * TBL_BOSS_OPERATOR， 
 * TBL_MERCHANT_OPERATOR .
 * 
 * @作者: WuShuicheng .
 * @创建时间: 2013-9-12,上午11:16:23 .
 * @版本: 1.0 .
 */
public enum ZtWL {

	/** 普通用户 **/
	SF("顺丰速运", "SF"),
	/** 超级管理员 **/
	HTKY("百世快递", "HTKY"),
	ZTO("中通快递", "ZTO"),
	STO("申通快递", "STO"),
	YTO("圆通速递", "YTO"),
	YD("韵达速递", "YD"),
	YZPY("邮政快递包裹", "YZPY"),
	EMS("EMS", "EMS"),
	HHTT("天天快递", "HHTT"),
	JD("京东物流", "JD"),
	UC("优速快递", "UC"),
	DBL("德邦快递", "DBL"),
	FAST("快捷快递", "FAST"),
	ZJS("宅急送", "ZJS"),
	TNT("TNT快递", "TNT"),
	UPS("UPS", "UPS"),
	DHL("DHL", "DHL");
	

	/** 描述 */
	private String logisticsName;
	/** 枚举值 */
	private String logisticsCode;

	private ZtWL(String logisticsName, String logisticsCode) {
		this.logisticsName = logisticsName;
		this.logisticsCode = logisticsCode;
	}

	
	public String getLogisticsName() {
		return logisticsName;
	}



	public void setLogisticsName(String logisticsName) {
		this.logisticsName = logisticsName;
	}







	public String getLogisticsCode() {
		return logisticsCode;
	}


	public void setLogisticsCode(String logisticsCode) {
		this.logisticsCode = logisticsCode;
	}


	public static ZtWL getEnum(String value){
		ZtWL resultEnum = null;
		ZtWL[] enumAry = ZtWL.values();
		for(int i = 0;i<enumAry.length;i++){
			if(enumAry[i].getLogisticsCode().equals(value)){
				resultEnum = enumAry[i];
				break;
			}
		}
		return resultEnum;
	}
	
	public static Map<String, Map<String, Object>> toMap() {
		ZtWL[] ary = ZtWL.values();
		Map<String, Map<String, Object>> enumMap = new HashMap<String, Map<String, Object>>();
		for (int num = 0; num < ary.length; num++) {
			Map<String, Object> map = new HashMap<String, Object>();
			String key = String.valueOf(getEnum(ary[num].getLogisticsCode()));
			map.put("logisticsCode", ary[num].getLogisticsCode());
			map.put("logisticsName", ary[num].getLogisticsName());
			enumMap.put(key, map);
		}
		return enumMap;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List toList(){
		ZtWL[] ary = ZtWL.values();
		List list = new ArrayList();
		for(int i=0;i<ary.length;i++){
			Map<String,String> map = new HashMap<String,String>();
			map.put("logisticsCode",ary[i].getLogisticsCode());
			map.put("logisticsName", ary[i].getLogisticsName());
			list.add(map);
		}
		return list;
	}
	
	public static String getKey(String value){
		ZtWL[] ary = ZtWL.values();
		
		String result="";
		for(int i=0;i<ary.length;i++){
			

			if(value.equals(ary[i].getLogisticsCode())){
				result=ary[i].getLogisticsName();
				break;
			}
		
		}
		return result;
	}
	
	public static String getValue(String key){
		ZtWL[] ary = ZtWL.values();
		
		String result="";
		for(int i=0;i<ary.length;i++){
			

			if(key.equals(ary[i].getLogisticsName())){
				result=ary[i].getLogisticsCode();
				break;
			}
		
		}
		return result;
	}
	
	
	public static void main(String[] args) {
		
		//System.out.println(getValue("百世快递"));
	}

}

